package com.xq.vo;

/**
 * 对前端的响应状态码的枚举类
 */
public enum ResultStatus {

    SUCCESS("操作成功"),
    FAIL("操作失败",9999),
    SERVER_BUSY("服务器繁忙",9998),
    API_UN_IMPL("功能尚未实现",9997),
    CONTENT_TYPE_ERR("contentType错误",9996),
    PARAMS_INVALID("上传参数异常", 9995),
    SERVER_ERROR("服务器错误", 9994),
    FORBIDDEN("没有相关权限", 403),
    UNAUTHORIZED("暂未登录或TOKEN已经过期", 401)
    ;

    /**
     * 携带的消息
     */
    private final String message;
    /**
     * 状态码
     */
    private final int code;


    ResultStatus(String message, int code) {
        this.message = message;
        this.code = code;
    }

    ResultStatus(String message) {
        this.message = message;
        this.code = 10000;
    }

    public String getMessage() {
        return message;
    }

    public int getCode() {
        return code;
    }
}
